//### This file created by BYACC 1.8(/Java extension  1.15)
//### Java capabilities added 7 Jan 97, Bob Jamison
//### Updated : 27 Nov 97  -- Bob Jamison, Joe Nieten
//###           01 Jan 98  -- Bob Jamison -- fixed generic semantic constructor
//###           01 Jun 99  -- Bob Jamison -- added Runnable support
//###           06 Aug 00  -- Bob Jamison -- made state variables class-global
//###           03 Jan 01  -- Bob Jamison -- improved flags, tracing
//###           16 May 01  -- Bob Jamison -- added custom stack sizing
//###           04 Mar 02  -- Yuval Oren  -- improved java performance, added options
//###           14 Mar 02  -- Tomas Hurka -- -d support, static initializer workaround
//### Please send bug reports to tom@hukatronic.cz
//### static char yysccsid[] = "@(#)yaccpar	1.8 (Berkeley) 01/20/90";






//#line 2 "Gas.y"
  import java.lang.Math;
  import java.io.*;
  import gas.frontend.*;
//#line 21 "Parser.java"




public class Parser
{

boolean yydebug;        //do I want debug output?
int yynerrs;            //number of errors so far
int yyerrflag;          //was there an error?
int yychar;             //the current working character

//########## MESSAGES ##########
//###############################################################
// method: debug
//###############################################################
void debug(String msg)
{
  if (yydebug)
    System.out.println(msg);
}

//########## STATE STACK ##########
final static int YYSTACKSIZE = 500;  //maximum stack size
int statestk[] = new int[YYSTACKSIZE]; //state stack
int stateptr;
int stateptrmax;                     //highest index of stackptr
int statemax;                        //state when highest index reached
//###############################################################
// methods: state stack push,pop,drop,peek
//###############################################################
final void state_push(int state)
{
  try {
		stateptr++;
		statestk[stateptr]=state;
	 }
	 catch (ArrayIndexOutOfBoundsException e) {
     int oldsize = statestk.length;
     int newsize = oldsize * 2;
     int[] newstack = new int[newsize];
     System.arraycopy(statestk,0,newstack,0,oldsize);
     statestk = newstack;
     statestk[stateptr]=state;
  }
}
final int state_pop()
{
  return statestk[stateptr--];
}
final void state_drop(int cnt)
{
  stateptr -= cnt; 
}
final int state_peek(int relative)
{
  return statestk[stateptr-relative];
}
//###############################################################
// method: init_stacks : allocate and prepare stacks
//###############################################################
final boolean init_stacks()
{
  stateptr = -1;
  val_init();
  return true;
}
//###############################################################
// method: dump_stacks : show n levels of the stacks
//###############################################################
void dump_stacks(int count)
{
int i;
  System.out.println("=index==state====value=     s:"+stateptr+"  v:"+valptr);
  for (i=0;i<count;i++)
    System.out.println(" "+i+"    "+statestk[i]+"      "+valstk[i]);
  System.out.println("======================");
}


//########## SEMANTIC VALUES ##########
//public class ParserVal is defined in ParserVal.java


String   yytext;//user variable to return contextual strings
ParserVal yyval; //used to return semantic vals from action routines
ParserVal yylval;//the 'lval' (result) I got from yylex()
ParserVal valstk[];
int valptr;
//###############################################################
// methods: value stack push,pop,drop,peek.
//###############################################################
void val_init()
{
  valstk=new ParserVal[YYSTACKSIZE];
  yyval=new ParserVal();
  yylval=new ParserVal();
  valptr=-1;
}
void val_push(ParserVal val)
{
  if (valptr>=YYSTACKSIZE)
    return;
  valstk[++valptr]=val;
}
ParserVal val_pop()
{
  if (valptr<0)
    return new ParserVal();
  return valstk[valptr--];
}
void val_drop(int cnt)
{
int ptr;
  ptr=valptr-cnt;
  if (ptr<0)
    return;
  valptr = ptr;
}
ParserVal val_peek(int relative)
{
int ptr;
  ptr=valptr-relative;
  if (ptr<0)
    return new ParserVal();
  return valstk[ptr];
}
final ParserVal dup_yyval(ParserVal val)
{
  ParserVal dup = new ParserVal();
  dup.ival = val.ival;
  dup.dval = val.dval;
  dup.sval = val.sval;
  dup.obj = val.obj;
  return dup;
}
//#### end semantic value section ####
public final static short IF=257;
public final static short ELSE=258;
public final static short FOR=259;
public final static short WHILE=260;
public final static short BREAK=261;
public final static short CONTINUE=262;
public final static short RETURN=263;
public final static short NEW=264;
public final static short FUNCTION=265;
public final static short TYPE=266;
public final static short TRUE=267;
public final static short FALSE=268;
public final static short DIGIT=269;
public final static short NUM=270;
public final static short ID=271;
public final static short STRING=272;
public final static short LPAREN=273;
public final static short RPAREN=274;
public final static short DOT=275;
public final static short MULT=276;
public final static short PLUS=277;
public final static short MINUS=278;
public final static short DIV=279;
public final static short POWER=280;
public final static short OR=281;
public final static short AND=282;
public final static short NOT=283;
public final static short SEMI=284;
public final static short LBRACE=285;
public final static short RBRACE=286;
public final static short LBLK=287;
public final static short RBLK=288;
public final static short ASGN=289;
public final static short COMMA=290;
public final static short GE=291;
public final static short LE=292;
public final static short GT=293;
public final static short LT=294;
public final static short EQL=295;
public final static short NEQL=296;
public final static short SHARP=297;
public final static short YYERRCODE=256;
final static short yylhs[] = {                           -1,
    0,    8,    8,    8,   10,   10,   11,   11,   13,   13,
   14,   12,    7,    7,    7,    7,    7,    7,    7,    7,
    7,   22,    7,    6,    6,    6,    6,    6,   23,   23,
   15,   15,   16,   17,    9,   18,   19,   20,   20,    5,
    4,    4,   25,   25,   26,   27,   27,   21,   21,   28,
   29,   29,   24,   24,   24,    2,    2,    2,    2,    2,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    1,    1,    1,    1,    3,    3,    3,    3,    3,    3,
};
final static short yylen[] = {                            2,
    1,    2,    2,    0,    7,    6,    3,    0,    4,    0,
    0,    4,    1,    1,    1,    1,    1,    1,    1,    1,
    1,    0,    2,    3,    5,   11,    9,   11,    3,    0,
    5,    7,    9,    5,    3,    2,    2,    2,    3,    4,
    2,    4,    2,    0,    4,    3,    0,    3,    5,    6,
    3,    0,    1,    3,    0,    1,    2,    2,    2,    3,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    3,
};
final static short yydefred[] = {                         0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,   20,   13,    0,    1,    0,   14,   15,   16,   17,
   18,   19,   21,    0,    0,    0,    0,   36,   37,   56,
    0,    0,    0,   38,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    2,    3,    0,   23,    0,    0,
    0,   76,   77,   75,    0,   57,    0,   79,   58,   59,
   69,   67,   68,   70,   71,   72,   73,   74,   39,   61,
   62,   63,   64,   65,   66,    0,    0,    0,   24,    0,
    0,    0,    0,   43,    0,    0,    0,    0,   48,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,   42,    0,    0,   40,   35,
    0,    0,   34,   80,    0,    0,   11,    0,    0,    0,
   25,   54,   49,    0,    0,    0,    0,    0,    0,   11,
    0,    7,    6,    0,    0,    0,    0,    0,   45,   51,
    0,   32,    0,    5,    0,    0,    0,    0,    0,   46,
   50,    0,    0,    0,    0,    0,    0,   33,    9,   12,
    0,    0,    0,   27,    0,    0,    0,   29,   26,   28,
};
final static short yydgoto[] = {                         10,
   76,   82,   56,   11,   12,   13,   14,   15,   48,   16,
   98,  133,  132,  134,   17,   18,   19,   20,   21,   22,
   23,   24,  162,   83,   41,   86,  125,   44,  108,
};
final static short yysindex[] = {                      -200,
 -267, -241, -237, -229, -216, -243, -202, -228, -222,    0,
 -259,    0,    0, -200,    0, -200,    0,    0,    0,    0,
    0,    0,    0, -238, -205, -205, -205,    0,    0,    0,
 -186, -186, -186,    0,   20, -194, -193, -170, -205, -179,
 -182, -165, -205, -169,    0,    0,  228,    0, -269,   41,
 -183,    0,    0,    0, -205,    0, -159,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0, -205, -153, -145,    0, -255,
 -233,   62, -152,    0, -205, -151, -150,   83,    0, -160,
  228, -205,  228,  -49,  188, -145, -143, -147, -157, -136,
 -137,  104, -205, -130,  125,    0, -104,  -93,    0,    0,
  -89,  146,    0,    0,  -84,  -98,    0,  -86,  -51,  -58,
    0,    0,    0, -205,  -71, -150, -205,  228, -205,    0,
  -40,    0,    0,  -50,  -48,  -30, -205,  125,    0,    0,
  -36,    0,   -1,    0,  -32,  228, -205,  -47,  -33,    0,
    0,  228,  -98,  -38,  167,  -21,  -34,    0,    0,    0,
 -205,  -35,  -31,    0,  167,  -29,  -28,    0,    0,    0,
};
final static short yyrindex[] = {                         3,
    0,    0,    0,    0,    0,    0,    0,    0, -144,    0,
    0,    0,    0,    3,    0,    3,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,  -22,    0,
 -118,    0,    0,    0,    0,    0,  -26,    0,    0,    0,
    0,    0,    0,    0,    0,    0,  -72,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,  -20,    0,    0,
    0,   -9,    0,    0,    0,  -95,   -5,    0,    0,    0,
  -26,    0,  -26,    0, -232,  -20,    0,    0,    0,    0,
    0,    0,  -22,    0,  -19,    0,    0,    0,    0,    0,
    1,    0,    0,    0,    0,   -4,    0,    0,    0,    0,
    0,    0,    0,    0,    0,   -5,  -22,  -26,    0,    0,
    0,    0,    0,    0,    0,    0,  -22,  -19,    0,    0,
    0,    0,    0,    0,    0,  -26,    0,    0,    0,    0,
    0,  -26,   -4,    0,  -12,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  -12,    0,    0,    0,    0,    0,
};
final static short yygindex[] = {                         0,
    0,   -6,  -15,   57,    0,    0,  -45,   60,    0,    0,
  157,  141,  130,    0,    0,    0,    0,    0,    0,    0,
   71,    0,  119,  -99,  199,    0,  151,    0,  179,
};
final static int YYTABLESIZE=499;
static short yytable[];
static { yytable();}
static void yytable(){
yytable = new short[]{                         35,
   31,   90,    4,  122,   91,   25,   61,   62,   63,   64,
   65,   66,   67,   68,   99,   42,   59,   60,   49,   50,
   51,   70,   71,   72,   73,   74,   75,  141,   30,   43,
  101,   26,  100,   31,   32,   27,   88,  149,   30,   33,
   34,   60,   38,   31,   32,  111,   47,  113,   94,   33,
   39,   60,   40,   60,   28,   60,    1,   60,    2,    3,
    4,    5,    6,   36,    7,    8,   30,   29,   37,   95,
    9,   31,   32,   45,  102,   46,   77,   33,  105,   78,
   52,   53,  142,   54,    9,  112,   55,   57,   57,   57,
   93,   84,   61,   62,   63,   64,   65,   66,   67,   68,
  154,   58,   58,   58,   85,   87,  158,   70,   71,   72,
   73,   74,   75,   79,   89,   42,   80,  138,   81,   96,
   97,  104,  143,   40,  107,  110,  117,  116,  120,   44,
  118,   44,   44,   44,   44,   44,   44,   44,   44,   44,
  155,   44,   44,   44,   44,   44,   44,   44,   44,   44,
   44,   44,  119,  123,  165,   41,   41,   41,   41,   41,
   41,   41,   41,   41,   41,   41,  126,   41,  128,   41,
   41,   41,   41,   41,   41,   41,   41,   41,   44,  127,
   44,   44,   44,   44,   44,   44,   44,   44,   44,  130,
   44,  131,   44,   44,   44,   44,   44,   44,   44,   44,
   44,   78,  135,   78,   78,   78,   78,   78,   78,   78,
   78,   78,  136,   78,  137,   78,  139,   78,   78,   78,
   78,   78,   78,   78,  114,  145,   61,   62,   63,   64,
   65,   66,   67,   68,  146,  148,  147,  151,  153,  156,
  157,   70,   71,   72,   73,   74,   75,  160,  163,  164,
  166,   55,  115,    8,  169,  170,  167,   31,   22,   31,
   31,   31,   31,   31,   53,   31,   31,   52,   47,   10,
  144,   31,  152,   30,   61,   62,   63,   64,   65,   66,
   67,   68,  159,  168,  106,   31,   31,   22,  150,   70,
   71,   72,   73,   74,   75,   61,   62,   63,   64,   65,
   66,   67,   68,   69,  140,    0,    0,    0,    0,    0,
   70,   71,   72,   73,   74,   75,   61,   62,   63,   64,
   65,   66,   67,   68,   92,    0,    0,    0,    0,    0,
    0,   70,   71,   72,   73,   74,   75,   61,   62,   63,
   64,   65,   66,   67,   68,    0,    0,    0,    0,    0,
    0,  103,   70,   71,   72,   73,   74,   75,   61,   62,
   63,   64,   65,   66,   67,   68,  109,    0,    0,    0,
    0,    0,    0,   70,   71,   72,   73,   74,   75,   61,
   62,   63,   64,   65,   66,   67,   68,  121,    0,    0,
    0,    0,    0,    0,   70,   71,   72,   73,   74,   75,
   61,   62,   63,   64,   65,   66,   67,   68,    0,    0,
    0,    0,    0,    0,  124,   70,   71,   72,   73,   74,
   75,   61,   62,   63,   64,   65,   66,   67,   68,  129,
    0,    0,    0,    0,    0,    0,   70,   71,   72,   73,
   74,   75,   61,   62,   63,   64,   65,   66,   67,   68,
    0,    0,    0,    0,    0,    0,  161,   70,   71,   72,
   73,   74,   75,   61,   62,   63,   64,   65,   66,   67,
   68,    0,    0,    0,    0,    0,    0,    0,   70,   71,
   72,   73,   74,   75,    1,    0,    2,    3,    4,    5,
    6,    0,    0,    8,    0,    0,    0,    0,    9,
};
}
static short yycheck[];
static { yycheck(); }
static void yycheck() {
yycheck = new short[] {                          6,
    0,   47,    0,  103,  274,  273,  276,  277,  278,  279,
  280,  281,  282,  283,  270,  275,   32,   33,   25,   26,
   27,  291,  292,  293,  294,  295,  296,  127,  272,  289,
  264,  273,  288,  277,  278,  273,   43,  137,  272,  283,
  284,  274,  271,  277,  278,   91,  285,   93,   55,  283,
  273,  284,  275,  286,  284,  288,  257,  290,  259,  260,
  261,  262,  263,  266,  265,  266,  272,  284,  271,   76,
  271,  277,  278,   14,   81,   16,  271,  283,   85,  273,
  267,  268,  128,  270,  271,   92,  273,   31,   32,   33,
  274,  271,  276,  277,  278,  279,  280,  281,  282,  283,
  146,   31,   32,   33,  287,  271,  152,  291,  292,  293,
  294,  295,  296,  284,  284,  275,  287,  124,  289,  273,
  266,  274,  129,  275,  275,  286,  274,  271,  266,  274,
  288,  276,  277,  278,  279,  280,  281,  282,  283,  284,
  147,  286,  287,  288,  289,  290,  291,  292,  293,  294,
  295,  296,  289,  284,  161,  274,  275,  276,  277,  278,
  279,  280,  281,  282,  283,  284,  271,  286,  258,  288,
  289,  290,  291,  292,  293,  294,  295,  296,  274,  273,
  276,  277,  278,  279,  280,  281,  282,  283,  284,  274,
  286,  290,  288,  289,  290,  291,  292,  293,  294,  295,
  296,  274,  289,  276,  277,  278,  279,  280,  281,  282,
  283,  284,  264,  286,  273,  288,  288,  290,  291,  292,
  293,  294,  295,  296,  274,  266,  276,  277,  278,  279,
  280,  281,  282,  283,  285,  266,  285,  274,  271,  287,
  274,  291,  292,  293,  294,  295,  296,  286,  270,  284,
  286,  274,   96,  274,  284,  284,  288,  257,  285,  259,
  260,  261,  262,  263,  274,  265,  266,  273,  288,  274,
  130,  271,  274,  286,  276,  277,  278,  279,  280,  281,
  282,  283,  153,  165,   86,  285,  286,  285,  138,  291,
  292,  293,  294,  295,  296,  276,  277,  278,  279,  280,
  281,  282,  283,  284,  126,   -1,   -1,   -1,   -1,   -1,
  291,  292,  293,  294,  295,  296,  276,  277,  278,  279,
  280,  281,  282,  283,  284,   -1,   -1,   -1,   -1,   -1,
   -1,  291,  292,  293,  294,  295,  296,  276,  277,  278,
  279,  280,  281,  282,  283,   -1,   -1,   -1,   -1,   -1,
   -1,  290,  291,  292,  293,  294,  295,  296,  276,  277,
  278,  279,  280,  281,  282,  283,  284,   -1,   -1,   -1,
   -1,   -1,   -1,  291,  292,  293,  294,  295,  296,  276,
  277,  278,  279,  280,  281,  282,  283,  284,   -1,   -1,
   -1,   -1,   -1,   -1,  291,  292,  293,  294,  295,  296,
  276,  277,  278,  279,  280,  281,  282,  283,   -1,   -1,
   -1,   -1,   -1,   -1,  290,  291,  292,  293,  294,  295,
  296,  276,  277,  278,  279,  280,  281,  282,  283,  284,
   -1,   -1,   -1,   -1,   -1,   -1,  291,  292,  293,  294,
  295,  296,  276,  277,  278,  279,  280,  281,  282,  283,
   -1,   -1,   -1,   -1,   -1,   -1,  290,  291,  292,  293,
  294,  295,  296,  276,  277,  278,  279,  280,  281,  282,
  283,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  291,  292,
  293,  294,  295,  296,  257,   -1,  259,  260,  261,  262,
  263,   -1,   -1,  266,   -1,   -1,   -1,   -1,  271,
};
}
final static short YYFINAL=10;
final static short YYMAXTOKEN=297;
final static String yyname[] = {
"end-of-file",null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,"'*'","'+'",null,
"'-'",null,"'/'",null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,"IF","ELSE","FOR","WHILE","BREAK","CONTINUE","RETURN",
"NEW","FUNCTION","TYPE","TRUE","FALSE","DIGIT","NUM","ID","STRING","LPAREN",
"RPAREN","DOT","MULT","PLUS","MINUS","DIV","POWER","OR","AND","NOT","SEMI",
"LBRACE","RBRACE","LBLK","RBLK","ASGN","COMMA","GE","LE","GT","LT","EQL","NEQL",
"SHARP",
};
final static String yyrule[] = {
"$accept : program",
"program : program_body",
"program_body : stmt program_body",
"program_body : function_def program_body",
"program_body :",
"function_def : FUNCTION TYPE ID LPAREN form_arg_list RPAREN func_body",
"function_def : FUNCTION ID LPAREN form_arg_list RPAREN func_body",
"form_arg_list : TYPE ID opt_form_arg_list",
"form_arg_list :",
"opt_form_arg_list : COMMA TYPE ID opt_form_arg_list",
"opt_form_arg_list :",
"$$1 :",
"func_body : $$1 LBRACE stmt RBRACE",
"stmt : decl_stmt",
"stmt : if_stmt",
"stmt : for_stmt",
"stmt : while_stmt",
"stmt : break_stmt",
"stmt : continue_stmt",
"stmt : return_stmt",
"stmt : assign_stmt",
"stmt : func_call_stmt",
"$$2 :",
"stmt : $$2 block",
"decl_stmt : TYPE ID SEMI",
"decl_stmt : TYPE ID ASGN expression SEMI",
"decl_stmt : TYPE ID LBLK NUM RBLK ASGN LBRACE expression opt_array_init_list RBRACE SEMI",
"decl_stmt : TYPE ID ASGN NEW TYPE LPAREN act_arg_list RPAREN SEMI",
"decl_stmt : TYPE ID LBLK RBLK ASGN NEW TYPE LBLK NUM RBLK SEMI",
"opt_array_init_list : COMMA expression opt_array_init_list",
"opt_array_init_list :",
"if_stmt : IF LPAREN expression RPAREN stmt",
"if_stmt : IF LPAREN expression RPAREN stmt ELSE stmt",
"for_stmt : FOR LPAREN expression SEMI expression SEMI expression RPAREN stmt",
"while_stmt : WHILE LPAREN expression RPAREN stmt",
"block : LBRACE stmt RBRACE",
"break_stmt : BREAK SEMI",
"continue_stmt : CONTINUE SEMI",
"return_stmt : RETURN SEMI",
"return_stmt : RETURN expression SEMI",
"assign_stmt : lvalue ASGN expression SEMI",
"lvalue : ID mem_val",
"lvalue : ID mem_val opt_arrpos mem_val",
"mem_val : DOT ID",
"mem_val :",
"opt_arrpos : LBLK expression opt_elements RBLK",
"opt_elements : COMMA expression opt_elements",
"opt_elements :",
"func_call_stmt : lvalue opt_func_call SEMI",
"func_call_stmt : ID LPAREN act_arg_list RPAREN SEMI",
"opt_func_call : DOT ID opt_mem LPAREN act_arg_list RPAREN",
"opt_mem : DOT ID opt_mem",
"opt_mem :",
"act_arg_list : expression",
"act_arg_list : expression COMMA act_arg_list",
"act_arg_list :",
"expression : STRING",
"expression : PLUS atom",
"expression : MINUS atom",
"expression : NOT atom",
"expression : expression op expression",
"op : GE",
"op : LE",
"op : GT",
"op : LT",
"op : EQL",
"op : NEQL",
"op : PLUS",
"op : MINUS",
"op : MULT",
"op : DIV",
"op : POWER",
"op : OR",
"op : AND",
"op : NOT",
"atom : NUM",
"atom : TRUE",
"atom : FALSE",
"atom : lvalue",
"atom : func_call_stmt",
"atom : LPAREN expression RPAREN",
};

//#line 334 "Gas.y"

/* a reference to the lexer object */
private Yylex lexer;

/* interface to the lexer */
private int yylex () {
    int yyl_return = -1;
    try {
      yylval = new ParserVal(0);
      yyl_return = lexer.yylex();
    }
    catch (IOException e) {
      System.err.println("IO error :"+e);
    }
    return yyl_return;
  }

/* error reporting */
public void yyerror (String error) {
    System.err.println ("Error: " + error);
  }

/* lexer is created in the constructor */
public Parser(Reader r) {
    lexer = new Yylex(r, this);
  }

SymbolTable st = new SymbolTable();
StorageMap  map = new StorageMap();

IntermediateCodeGenerator icg = new IntermediateCodeGenerator(null, map);
//#line 473 "Parser.java"
//###############################################################
// method: yylexdebug : check lexer state
//###############################################################
void yylexdebug(int state,int ch)
{
String s=null;
  if (ch < 0) ch=0;
  if (ch <= YYMAXTOKEN) //check index bounds
     s = yyname[ch];    //now get it
  if (s==null)
    s = "illegal-symbol";
  debug("state "+state+", reading "+ch+" ("+s+")");
}





//The following are now global, to aid in error reporting
int yyn;       //next next thing to do
int yym;       //
int yystate;   //current parsing state from state table
String yys;    //current token string


//###############################################################
// method: yyparse : parse input and execute indicated items
//###############################################################
int yyparse()
{
boolean doaction;
  init_stacks();
  yynerrs = 0;
  yyerrflag = 0;
  yychar = -1;          //impossible char forces a read
  yystate=0;            //initial state
  state_push(yystate);  //save it
  val_push(yylval);     //save empty value
  while (true) //until parsing is done, either correctly, or w/error
    {
    doaction=true;
    if (yydebug) debug("loop"); 
    //#### NEXT ACTION (from reduction table)
    for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate])
      {
      if (yydebug) debug("yyn:"+yyn+"  state:"+yystate+"  yychar:"+yychar);
      if (yychar < 0)      //we want a char?
        {
        yychar = yylex();  //get next token
        if (yydebug) debug(" next yychar:"+yychar);
        //#### ERROR CHECK ####
        if (yychar < 0)    //it it didn't work/error
          {
          yychar = 0;      //change it to default string (no -1!)
          if (yydebug)
            yylexdebug(yystate,yychar);
          }
        }//yychar<0
      yyn = yysindex[yystate];  //get amount to shift by (shift index)
      if ((yyn != 0) && (yyn += yychar) >= 0 &&
          yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
        {
        if (yydebug)
          debug("state "+yystate+", shifting to state "+yytable[yyn]);
        //#### NEXT STATE ####
        yystate = yytable[yyn];//we are in a new state
        state_push(yystate);   //save it
        val_push(yylval);      //push our lval as the input for next rule
        yychar = -1;           //since we have 'eaten' a token, say we need another
        if (yyerrflag > 0)     //have we recovered an error?
           --yyerrflag;        //give ourselves credit
        doaction=false;        //but don't process yet
        break;   //quit the yyn=0 loop
        }

    yyn = yyrindex[yystate];  //reduce
    if ((yyn !=0 ) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
      {   //we reduced!
      if (yydebug) debug("reduce");
      yyn = yytable[yyn];
      doaction=true; //get ready to execute
      break;         //drop down to actions
      }
    else //ERROR RECOVERY
      {
      if (yyerrflag==0)
        {
        yyerror("syntax error");
        yynerrs++;
        }
      if (yyerrflag < 3) //low error count?
        {
        yyerrflag = 3;
        while (true)   //do until break
          {
          if (stateptr<0)   //check for under & overflow here
            {
            yyerror("stack underflow. aborting...");  //note lower case 's'
            return 1;
            }
          yyn = yysindex[state_peek(0)];
          if ((yyn != 0) && (yyn += YYERRCODE) >= 0 &&
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
            {
            if (yydebug)
              debug("state "+state_peek(0)+", error recovery shifting to state "+yytable[yyn]+" ");
            yystate = yytable[yyn];
            state_push(yystate);
            val_push(yylval);
            doaction=false;
            break;
            }
          else
            {
            if (yydebug)
              debug("error recovery discarding state "+state_peek(0)+" ");
            if (stateptr<0)   //check for under & overflow here
              {
              yyerror("Stack underflow. aborting...");  //capital 'S'
              return 1;
              }
            state_pop();
            val_pop();
            }
          }
        }
      else            //discard this token
        {
        if (yychar == 0)
          return 1; //yyabort
        if (yydebug)
          {
          yys = null;
          if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
          if (yys == null) yys = "illegal-symbol";
          debug("state "+yystate+", error recovery discards token "+yychar+" ("+yys+")");
          }
        yychar = -1;  //read another
        }
      }//end error recovery
    }//yyn=0 loop
    if (!doaction)   //any reason not to proceed?
      continue;      //skip action
    yym = yylen[yyn];          //get count of terminals on rhs
    if (yydebug)
      debug("state "+yystate+", reducing "+yym+" by rule "+yyn+" ("+yyrule[yyn]+")");
    if (yym>0)                 //if count of rhs not 'nil'
      yyval = val_peek(yym-1); //get current semantic value
    yyval = dup_yyval(yyval); //duplicate yyval if ParserVal is used as semantic value
    switch(yyn)
      {
//########## USER-SUPPLIED ACTIONS ##########
case 1:
//#line 70 "Gas.y"
{  System.out.println("program"); TreeNode p = new TreeNode(); 
                                            p.code = ((TreeNode)val_peek(0).obj).code;
                                            yyval.obj = (Object) p;
                                            System.out.println(p.code);
                                         }
break;
case 2:
//#line 77 "Gas.y"
{  TreeNode pb = new TreeNode(); 
                                                                pb.code = ((TreeNode)val_peek(1).obj).code;
                                                                pb.code += ((TreeNode)val_peek(0).obj).code;
                                                                yyval.obj = (Object) pb; }
break;
case 3:
//#line 81 "Gas.y"
{ }
break;
case 4:
//#line 82 "Gas.y"
{ TreeNode pb = new TreeNode(); 
                            pb.code = "";
                            yyval.obj = (Object) pb; }
break;
case 5:
//#line 87 "Gas.y"
{}
break;
case 6:
//#line 88 "Gas.y"
{}
break;
case 7:
//#line 91 "Gas.y"
{}
break;
case 9:
//#line 95 "Gas.y"
{}
break;
case 11:
//#line 99 "Gas.y"
{ st.enterScope(); }
break;
case 12:
//#line 99 "Gas.y"
{ try {st.leaveScope();} catch(Exception e) {} }
break;
case 13:
//#line 103 "Gas.y"
{  TreeNode stmt = new TreeNode(); 
                                   stmt.code = ((TreeNode)val_peek(0).obj).code;
                                   yyval.obj = (Object) stmt; }
break;
case 14:
//#line 106 "Gas.y"
{}
break;
case 15:
//#line 107 "Gas.y"
{}
break;
case 16:
//#line 108 "Gas.y"
{}
break;
case 17:
//#line 109 "Gas.y"
{}
break;
case 18:
//#line 110 "Gas.y"
{}
break;
case 19:
//#line 111 "Gas.y"
{}
break;
case 20:
//#line 112 "Gas.y"
{}
break;
case 21:
//#line 113 "Gas.y"
{}
break;
case 22:
//#line 114 "Gas.y"
{System.out.println("hereeeee"); st.enterScope();}
break;
case 23:
//#line 114 "Gas.y"
{ 
                                                     TreeNode block = new TreeNode(); 
                                                     block.code = ((TreeNode)val_peek(1).obj).code;
                                                     yyval.obj = (Object) block;
                                                     try {
                                                          st.leaveScope();
                                                     } catch(Exception e) {} 
                                                 }
break;
case 24:
//#line 125 "Gas.y"
{                                                      
                                                      TreeNode decl_stmt = new TreeNode();
                                                      TreeNode TYPE = new TreeNode();
                                                      TreeNode ID = new TreeNode();
                                                      ID.value = val_peek(1).sval;
                                                      try {
                                                           String newID = st.register(val_peek(1).sval);
                                                           /* deal with init value*/
                                                           map.put(newID, new Symbol(val_peek(2).sval,  null));
                                                           ID.addr = newID;
                                                           decl_stmt.type = val_peek(2).sval;
                                                           icg.ProcessDeclaration(decl_stmt, newID);
                                                           yyval.obj = (Object)decl_stmt;
                                                           String testcode = ((TreeNode)yyval.obj).code;                                                          
                                                      }
                                                       catch (AlreadyDefinedVariableException e) {
                                                           System.out.println("Already defined variable error");
                                                           yyval.obj = (Object) new TreeNode();
                                                      }
                                                                            
                                            }
break;
case 25:
//#line 146 "Gas.y"
{}
break;
case 26:
//#line 147 "Gas.y"
{}
break;
case 27:
//#line 148 "Gas.y"
{}
break;
case 28:
//#line 149 "Gas.y"
{}
break;
case 29:
//#line 152 "Gas.y"
{}
break;
case 31:
//#line 157 "Gas.y"
{}
break;
case 32:
//#line 158 "Gas.y"
{}
break;
case 33:
//#line 161 "Gas.y"
{}
break;
case 34:
//#line 164 "Gas.y"
{}
break;
case 35:
//#line 167 "Gas.y"
{   System.out.println("thereeeeee");
                                                        TreeNode block = new TreeNode();
                                                        block.code = ((TreeNode) val_peek(1).obj).code;
                                                        yyval.obj = (Object) block;            
                                                    }
break;
case 36:
//#line 174 "Gas.y"
{}
break;
case 37:
//#line 177 "Gas.y"
{}
break;
case 38:
//#line 180 "Gas.y"
{}
break;
case 39:
//#line 181 "Gas.y"
{}
break;
case 40:
//#line 184 "Gas.y"
{ 
                               System.out.println("assign_stmt");
                                TreeNode assign_stmt = new TreeNode(); TreeNode ASGN = new TreeNode();
                                TreeNode SEMI = new TreeNode(); assign_stmt.child = ((TreeNode)val_peek(3).obj); assign_stmt.parent = null;
                                assign_stmt.sibling = null; assign_stmt.type = "assignstmt"; assign_stmt.value = null; 
                               ( (TreeNode)val_peek(3).obj).parent = assign_stmt; ( (TreeNode)val_peek(3).obj). sibling = ASGN; ASGN.child = null; ASGN.parent = null; ASGN.sibling = ((TreeNode)val_peek(1).obj); ASGN.type = "ASGN"; ASGN.value = "ASGN"; 
 ((TreeNode)val_peek(1).obj).parent = null; ((TreeNode)val_peek(1).obj).sibling = SEMI; SEMI.child = null; SEMI.parent = null; 
SEMI.sibling= null; SEMI.type = "SEMI"; SEMI.value ="SEMI";
                                 yyval.obj = (Object)assign_stmt;  val_peek(2).obj = (Object)ASGN; val_peek(0).obj = (Object)SEMI;

                                                                        
                                                         }
break;
case 41:
//#line 198 "Gas.y"
{System.out.println("lvalue ID");System.out.println(val_peek(1).sval);}
break;
case 42:
//#line 199 "Gas.y"
{}
break;
case 43:
//#line 202 "Gas.y"
{}
break;
case 45:
//#line 206 "Gas.y"
{}
break;
case 46:
//#line 209 "Gas.y"
{}
break;
case 48:
//#line 213 "Gas.y"
{}
break;
case 49:
//#line 214 "Gas.y"
{}
break;
case 50:
//#line 217 "Gas.y"
{}
break;
case 51:
//#line 220 "Gas.y"
{}
break;
case 53:
//#line 224 "Gas.y"
{}
break;
case 54:
//#line 225 "Gas.y"
{}
break;
case 56:
//#line 229 "Gas.y"
{TreeNode expression = new TreeNode(); 
                                        TreeNode STRING = new TreeNode(); expression.child = STRING; 
                                      expression.parent= null; expression.sibling = null; expression.type = "expression"; 
                                      expression.value = null; STRING.child = null; 
                                       STRING.parent = expression; STRING.sibling = null; STRING.type = "STRING"; 
                                        STRING.value = val_peek(0).sval;
                                          yyval.obj=(Object)expression; val_peek(0).sval=String.valueOf(STRING);}
break;
case 57:
//#line 236 "Gas.y"
{TreeNode expression = new TreeNode(); 
                                        TreeNode PLUS = new TreeNode(); TreeNode atom = new TreeNode(); 
                                       expression.child = PLUS; 
                                      expression.parent= null; expression.sibling = null; expression.type = "expression"; 
                                      expression.value = null; PLUS.child = null; 
                                       PLUS.parent = expression; PLUS.sibling = atom; PLUS.type = "op"; 
                                        PLUS.value ="PLUS"; atom.child = null; atom.parent = null; atom.sibling = null; 
                                         atom.type = "atom"; atom.value = null;
                                          yyval.obj=(Object)expression; val_peek(1).obj=(Object)PLUS; val_peek(0).obj = (Object) atom;}
break;
case 58:
//#line 245 "Gas.y"
{TreeNode expression = new TreeNode(); 
                                        TreeNode MINUS = new TreeNode(); TreeNode atom = new TreeNode(); 
                                       expression.child = MINUS; 
                                      expression.parent= null; expression.sibling = null; expression.type = "expression"; 
                                      expression.value = null; MINUS.child = null; 
                                       MINUS.parent = expression; MINUS.sibling = atom; MINUS.type = "op"; 
                                        MINUS.value ="MINUS"; atom.child = null; atom.parent = null; atom.sibling = null; 
                                         atom.type = "atom"; atom.value = null;
                                          yyval.obj=(Object)expression; val_peek(1).obj=(Object)MINUS; val_peek(0).obj = (Object) atom;}
break;
case 59:
//#line 254 "Gas.y"
{TreeNode expression = new TreeNode(); 
                                        TreeNode NOT= new TreeNode(); TreeNode atom = new TreeNode(); 
                                       expression.child = NOT; 
                                      expression.parent= null; expression.sibling = null; expression.type = "expression"; 
                                      expression.value = null; NOT.child = null; 
                                      NOT.parent = expression; NOT.sibling = atom; NOT.type = "op"; 
                                        NOT.value ="NOT"; atom.child = null; atom.parent = null; atom.sibling = null; 
                                         atom.type = "atom"; atom.value = null;
                                          yyval.obj=(Object)expression; val_peek(1).obj=(Object)NOT; val_peek(0).obj = (Object) atom;}
break;
case 60:
//#line 263 "Gas.y"
{TreeNode expression = new TreeNode(); 
                                        TreeNode expression1= new TreeNode(); TreeNode op = new TreeNode(); 
                                         TreeNode expression2 = new TreeNode();
                                       expression.child = expression1; 
                                      expression.parent= null; expression.sibling = null; expression.type = "expression"; 
                                      expression.value = null; expression1.child = null; 
                                      expression1.parent = expression; expression1.sibling = op; expression1.type = "expression"; 
                                        expression1.value = null; op.child = null; op.parent = null; op.sibling = expression2; 
                                         op.type = "op"; op.value = null; expression2.child = null; 
                                      expression2.parent = null; expression2.sibling = null; expression2.type = "expression"; 
                                        expression2.value = null;
                                          yyval.obj=(Object)expression; val_peek(2).obj=(Object)expression1; val_peek(1).obj = (Object) op; 
                                         val_peek(0).obj = (Object)expression2;}
break;
case 61:
//#line 278 "Gas.y"
{    TreeNode op = new TreeNode(); 
                                        TreeNode GE = new TreeNode(); op.child = GE; 
                                      op.parent= null; op.sibling = null; op.type = "op"; op.value = null; GE.child = null; 
                                       GE.parent = op; GE.sibling = null; GE.type = "op"; GE.value = "GE";
                                          yyval.obj=(Object)op; val_peek(0).obj=(Object)GE;}
break;
case 62:
//#line 283 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode LE = new TreeNode(); op.child = LE; 
                                     op.parent= null; op.sibling = null; op.type = "op"; op.value = null; LE.child = null;
                                        LE.parent = op; LE.sibling = null; LE.type = "op"; LE.value = "LE";
                                     yyval.obj=(Object)op; val_peek(0).obj=(Object)LE; }
break;
case 63:
//#line 287 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode GT = new TreeNode(); op.child = GT; op.parent= null;                      op.sibling = null; op.type = "op"; op.value = null; GT.child = null; GT.parent = op;                                                   GT.sibling = null; GT.type = "op"; GT.value = "GT"; yyval.obj=(Object)op; val_peek(0).obj=(Object)GT;}
break;
case 64:
//#line 288 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode LT = new TreeNode(); op.child = LT; op.parent= null;                       op.sibling = null; op.type = "op"; op.value = null; LT.child = null; LT.parent = op;                                                         LT.sibling = null; LT.type = "op"; LT.value = "LT"; yyval.obj=(Object)op; val_peek(0).obj=(Object)LT;}
break;
case 65:
//#line 289 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode EQL = new TreeNode(); op.child = EQL; op.parent= null;                          op.sibling = null; op.type = "op"; op.value = null; EQL.child = null; EQL.parent = op;                                            EQL.sibling = null; EQL.type = "op"; EQL.value = "EQL"; yyval.obj=(Object)op; val_peek(0).obj=(Object)EQL;}
break;
case 66:
//#line 290 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode NEQL = new TreeNode(); op.child = NEQL; op.parent= null;           op.sibling = null; op.type = "op"; op.value = null; NEQL.child = null; NEQL.parent = op;                           NEQL.sibling = null; NEQL.type = "op"; NEQL.value = "NEQL"; yyval.obj=(Object)op; val_peek(0).obj=(Object)NEQL;}
break;
case 67:
//#line 291 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode PLUS = new TreeNode(); op.child = PLUS; op.parent= null;          op.sibling = null; op.type = "op"; op.value = null; PLUS.child = null; PLUS.parent = op;                           PLUS.sibling = null; PLUS.type = "op"; PLUS.value = "PLUS"; yyval.obj=(Object)op; val_peek(0).obj=(Object)PLUS;}
break;
case 68:
//#line 292 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode MINUS = new TreeNode(); op.child = MINUS; 
                op.parent= null; op.sibling = null; op.type = "op"; op.value = null; MINUS.child = null; MINUS.parent = op;                    MINUS.sibling = null; MINUS.type = "op"; MINUS.value = "MINUS"; yyval.obj=(Object)op; val_peek(0).obj=(Object)MINUS;}
break;
case 69:
//#line 294 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode MULT = new TreeNode(); op.child = MULT; op.parent= null;             op.sibling = null; op.type = "op"; op.value = null; MULT.child = null; MULT.parent = op;                          MULT.sibling = null; MULT.type = "op"; MULT.value = "MULT"; yyval.obj=(Object)op; val_peek(0).obj=(Object)MULT;}
break;
case 70:
//#line 295 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode DIV = new TreeNode(); op.child = DIV; op.parent = null;            op.sibling = null; op.type = "op"; op.value = null; DIV.child = null; DIV.parent = op;                                        DIV.sibling = null; DIV.type = "op"; DIV.value = "DIV"; yyval.obj=(Object)op; val_peek(0).obj=(Object)DIV;}
break;
case 71:
//#line 296 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode POWER = new TreeNode(); op.child = POWER; 
 op.parent  = null; op.sibling = null; op.type = "op"; op.value = null; POWER.child = null; POWER.parent = op;                POWER.sibling = null; POWER.type = "op"; POWER.value = "POWER"; yyval.obj=(Object)op; val_peek(0).obj=(Object)POWER;}
break;
case 72:
//#line 298 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode OR = new TreeNode(); op.child = OR; op.parent= null;    op.sibling = null; op.type = "op"; op.value = null; OR.child = null; OR.parent = op;      OR.sibling = null; 
OR.type = "op"; OR.value = "OR"; yyval.obj=(Object)op; val_peek(0).obj=(Object)OR;}
break;
case 73:
//#line 300 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode AND = new TreeNode(); op.child = AND; op.parent = null;     op.sibling = null; op.type = "op"; op.value = null; AND.child = null; AND.parent = op;  AND.sibling = null; 
AND.type = "op"; AND.value = "AND"; yyval.obj=(Object)op; val_peek(0).obj=(Object)AND;}
break;
case 74:
//#line 302 "Gas.y"
{ TreeNode op = new TreeNode(); TreeNode NOT = new TreeNode(); op.child = NOT; op.parent = null;     op.sibling = null; op.type = "op"; op.value = null; NOT.child = null; NOT.parent = op;  NOT.sibling = null; 
NOT.type = "op"; NOT.value = "NOT"; yyval.obj=(Object)op; val_peek(0).obj=(Object)NOT;}
break;
case 75:
//#line 306 "Gas.y"
{TreeNode atom = new TreeNode(); 
                                        TreeNode NUM = new TreeNode(); atom.child = NUM; 
                                      atom.parent= null; atom.sibling = null; atom.type = "atom"; atom.value = null; NUM.child = null; 
                                       NUM.parent = atom; NUM.sibling = null; NUM.type = "NUM"; NUM.value = val_peek(0).sval;
                                          yyval.obj=(Object)atom; val_peek(0).sval=String.valueOf(NUM);}
break;
case 76:
//#line 311 "Gas.y"
{TreeNode atom = new TreeNode(); 
                                        TreeNode TRUE = new TreeNode(); atom.child = TRUE; 
                                      atom.parent= null; atom.sibling = null; atom.type = "atom"; atom.value = null; 
                                  TRUE.child = null; 
                                       TRUE.parent = atom; TRUE.sibling = null; TRUE.type = "Boolean"; TRUE.value = "TRUE";
                                          yyval.obj=(Object)atom; val_peek(0).obj=(Object)TRUE;}
break;
case 77:
//#line 317 "Gas.y"
{TreeNode atom = new TreeNode(); 
                                        TreeNode FALSE = new TreeNode(); atom.child = FALSE; 
                                      atom.parent= null; atom.sibling = null; atom.type = "atom"; atom.value = null; 
                                      FALSE.child = null; 
                                       FALSE.parent = atom; FALSE.sibling = null; FALSE.type = "Boolean"; 
                                         FALSE.value = "FALSE";
                                          yyval.obj=(Object)atom; val_peek(0).obj=(Object)FALSE;}
break;
case 78:
//#line 324 "Gas.y"
{}
break;
case 79:
//#line 325 "Gas.y"
{}
break;
case 80:
//#line 326 "Gas.y"
{}
break;
//#line 1036 "Parser.java"
//########## END OF USER-SUPPLIED ACTIONS ##########
    }//switch
    //#### Now let's reduce... ####
    if (yydebug) debug("reduce");
    state_drop(yym);             //we just reduced yylen states
    yystate = state_peek(0);     //get new state
    val_drop(yym);               //corresponding value drop
    yym = yylhs[yyn];            //select next TERMINAL(on lhs)
    if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL
      {
      if (yydebug) debug("After reduction, shifting from state 0 to state "+YYFINAL+"");
      yystate = YYFINAL;         //explicitly say we're done
      state_push(YYFINAL);       //and save it
      val_push(yyval);           //also save the semantic value of parsing
      if (yychar < 0)            //we want another character?
        {
        yychar = yylex();        //get next character
        if (yychar<0) yychar=0;  //clean, if necessary
        if (yydebug)
          yylexdebug(yystate,yychar);
        }
      if (yychar == 0)          //Good exit (if lex returns 0 ;-)
         break;                 //quit the loop--all DONE
      }//if yystate
    else                        //else not done yet
      {                         //get next state and push, for next yydefred[]
      yyn = yygindex[yym];      //find out where to go
      if ((yyn != 0) && (yyn += yystate) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
        yystate = yytable[yyn]; //get new state
      else
        yystate = yydgoto[yym]; //else go to new defred
      if (yydebug) debug("after reduction, shifting from state "+state_peek(0)+" to state "+yystate+"");
      state_push(yystate);     //going again, so push state & val...
      val_push(yyval);         //for next action
      }
    }//main loop
  return 0;//yyaccept!!
}
//## end of method parse() ######################################



//## run() --- for Thread #######################################
/**
 * A default run method, used for operating this parser
 * object in the background.  It is intended for extending Thread
 * or implementing Runnable.  Turn off with -Jnorun .
 */
public void run()
{
  yyparse();
}
//## end of method run() ########################################



//## Constructors ###############################################
/**
 * Default constructor.  Turn off with -Jnoconstruct .

 */
public Parser()
{
  //nothing to do
}


/**
 * Create a parser, setting the debug to true or false.
 * @param debugMe true for debugging, false for no debug.
 */
public Parser(boolean debugMe)
{
  yydebug=debugMe;
}
//###############################################################



}
//################### END OF CLASS ##############################
